<template>
  <sweet-button text @click="open('warning')">Warning</sweet-button>
  <sweet-button text @click="open('success')">Success</sweet-button>
  <sweet-button text @click="open('info')">Info</sweet-button>
  <sweet-button text @click="open('error')">Error</sweet-button>
</template>

<script setup>
import { SweetMessage, SweetMessageBox } from '@hw-seq/sweet-ui-base';

const open = type => {
  SweetMessageBox.confirm('proxy will permanently delete the file. Continue?', 'Warning', {
    type,
    namespace: 'sweet',
  })
    .then(() => {
      SweetMessage({
        type: 'success',
        message: 'Delete completed',
        customClass: 'ddd',
        namespace: 'sweet',
      });
    })
    .catch(() => {
      SweetMessage({
        type: 'info',
        message: 'Delete canceled',
        namespace: 'sweet',
      });
    });
};
</script>
